package com.moss.cloud.common.file.utils;


import com.moss.cloud.common.file.exception.StorageException;
import com.moss.cloud.common.file.handel.ThrowExceptionHandel;

public class BooleanHandel {
    /**
     *  如果参数为true抛出异常
     *
     * @param b
     * @return
     **/
    public static ThrowExceptionHandel trueThrow(Boolean b){
        return (errorMessage) -> {
            if (b){
                throw new StorageException(errorMessage);
            }
        };
    }
}
